package com.chenjinyan.dao;

import com.chenjinyan.entity.GoodsEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @author chenjinyan
 * @version 1.0
 */
@Repository
public interface GoodsRepository extends JpaRepository<GoodsEntity, Long> {
    @Override
    @Modifying
    @Transactional
    GoodsEntity saveAndFlush(GoodsEntity goodsEntity);

    List<GoodsEntity> findById(Long id);

}
